<?php
function sub_str($str,$start=0,$len=50){
    return mb_substr($str,$start,$len,"utf-8")."...";
}

function getCategory (){
    	$nidArr = M('Category')->field('id')->where(array('title'=>'竞赛通知'))->select();
    	$cidArr = M('Category')->field('id')->where(array('title'=>'历届比赛'))->select();
    	$oidArr = M('Category')->field('id')->where(array('title'=>'组织结构'))->select();
    	return  array(
    		'notificationId' => $nidArr[0]['id'],
    		'competitionId' => $cidArr[0]['id'],
    		'organizationId' => $oidArr[0]['id']
		);
}

?>
